**Use incentives_in_voting_surveys.dta


gen voted_econ_score = 0 //this uses the party scores of kieskompas
replace voted_econ_score = voted_econ_score + 1.1 if VVD==1
replace voted_econ_score = voted_econ_score -0.3 if PVV==1
replace voted_econ_score = voted_econ_score +0.1 if CDA==1
replace voted_econ_score = voted_econ_score -0.1 if D66==1
replace voted_econ_score = voted_econ_score -1.4 if GROEN==1
replace voted_econ_score = voted_econ_score -2 if SP==1
replace voted_econ_score = voted_econ_score -1.3 if PvdA==1
replace voted_econ_score = voted_econ_score - 0.4 if CU==1
replace voted_econ_score = voted_econ_score -2 if Dieren==1
replace voted_econ_score = voted_econ_score - 0.4 if PLUS==1
replace voted_econ_score = voted_econ_score + 0.7 if SGP==1
replace voted_econ_score = voted_econ_score -1.4 if DENK==1
replace voted_econ_score = voted_econ_score + 1.4 if Forum==1
replace voted_econ_score = voted_econ_score - 2 if BIJ1==1
replace voted_econ_score = voted_econ_score + 0.6 if BBB==1

gen votes_for_unlisted = Piraten+Oranje+JONG+NIDA+NLBeter+Toekomst+Platform
gen checked=total_votes - votes_for_unlisted

replace voted_econ_score = voted_econ_score/(total_votes - votes_for_unlisted)

gen voted_social_score = 0 //this uses the party scores of kieskompas
replace voted_social_score = voted_social_score -0.4 if VVD==1
replace voted_social_score = voted_social_score -1.5 if PVV==1
replace voted_social_score = voted_social_score -0.5 if CDA==1
replace voted_social_score = voted_social_score +1.4 if D66==1
replace voted_social_score = voted_social_score +1.35 if GROEN==1
replace voted_social_score = voted_social_score +0.8 if SP==1
replace voted_social_score = voted_social_score +1 if PvdA==1
replace voted_social_score = voted_social_score +0.3 if CU==1
replace voted_social_score = voted_social_score +1.3 if Dieren==1
replace voted_social_score = voted_social_score -0.25 if PLUS==1
replace voted_social_score = voted_social_score -0.95 if SGP==1
replace voted_social_score = voted_social_score +0.8 if DENK==1
replace voted_social_score = voted_social_score -1.5 if Forum==1
replace voted_social_score = voted_social_score +1.7 if BIJ1==1
replace voted_social_score = voted_social_score -0.7 if BBB==1

replace voted_social_score = voted_social_score/(total_votes- votes_for_unlisted)

gen ed_center = sqrt(voted_social_score* voted_social_score + voted_econ_score* voted_econ_score)

*scale elicited political views to fit the kieskompas scores
gen scale_econ=4* econ_views/10 - 2
gen scale_social=4* social_views/10 - 2
replace scale_social=scale_social*(-1)

gen diff_econ = abs(scale_econ - voted_econ_score)
gen diff_social = abs(scale_social - voted_social_score)

gen total_diff = sqrt(diff_econ*diff_econ + diff_social*diff_social)


***Effective number of parties
set seed 5102020

capture program drop effective_numberP
program define effective_numberP, rclass
tempname v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24
summarize VVD if treatment=="P" & completed==1
scalar `v1' = (r(mean))^2
summarize PVV if treatment=="P" & completed==1
scalar `v2' = (r(mean))^2
summarize CDA if treatment=="P" & completed==1
scalar `v3' = (r(mean))^2
summarize D66 if treatment=="P" & completed==1
scalar `v4' = (r(mean))^2
summarize GROEN if treatment=="P" & completed==1
scalar `v5' = (r(mean))^2
summarize SP if treatment=="P" & completed==1
scalar `v6' = (r(mean))^2
summarize PvdA if treatment=="P" & completed==1
scalar `v7' = (r(mean))^2
summarize CU if treatment=="P" & completed==1
scalar `v8' = (r(mean))^2
summarize Dieren if treatment=="P" & completed==1
scalar `v9' = (r(mean))^2
summarize PLUS if treatment=="P" & completed==1
scalar `v10' = (r(mean))^2
summarize SGP if treatment=="P" & completed==1
scalar `v11' = (r(mean))^2
summarize DENK if treatment=="P" & completed==1
scalar `v12' = (r(mean))^2
summarize Forum if treatment=="P" & completed==1
scalar `v13' = (r(mean))^2
summarize Piraten if treatment=="P" & completed==1
scalar `v14' = (r(mean))^2
summarize BIJ1 if treatment=="P" & completed==1
scalar `v15' = (r(mean))^2
summarize LP if treatment=="P" & completed==1
scalar `v16' = (r(mean))^2
summarize BBB if treatment=="P" & completed==1
scalar `v17' = (r(mean))^2
summarize Oranje if treatment=="P" & completed==1
scalar `v18' = (r(mean))^2
summarize JONG if treatment=="P" & completed==1
scalar `v19' = (r(mean))^2
summarize NIDA if treatment=="P" & completed==1
scalar `v20' = (r(mean))^2
summarize NLBeter if treatment=="P" & completed==1
scalar `v21' = (r(mean))^2
summarize Toekomst if treatment=="P" & completed==1
scalar `v22' = (r(mean))^2
summarize Platform if treatment=="P" & completed==1
scalar `v23' = (r(mean))^2
summarize Volt if treatment=="P" & completed==1
scalar `v24' = (r(mean))^2
return scalar effective_n = 1/(`v1'+ `v2'+`v3'+`v4'+`v5'+`v6'+`v7'+`v8'+`v9'+`v10'+`v11'+`v12'+`v13'+`v14'+`v15'+`v16'+`v17'+`v18'+`v19'+`v20'+`v21'+`v22'+`v23'+`v24')
end

bootstrap effective_n=r(effective_n) if treatment=="P" & completed==1, reps(1000) nowarn nodots: effective_numberP

bootstrap effective_n=r(effective_n) if treatment=="P" & completed==1, reps(1000) saving(P_en) nowarn nodots: effective_numberP

set seed 05102020

capture program drop effective_numberPI
program define effective_numberPI, rclass
tempname v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24
summarize VVD if treatment=="PI" & completed==1
scalar `v1' = (r(mean))^2
summarize PVV if treatment=="PI" & completed==1
scalar `v2' = (r(mean))^2
summarize CDA if treatment=="PI" & completed==1
scalar `v3' = (r(mean))^2
summarize D66 if treatment=="PI" & completed==1
scalar `v4' = (r(mean))^2
summarize GROEN if treatment=="PI" & completed==1
scalar `v5' = (r(mean))^2
summarize SP if treatment=="PI" & completed==1
scalar `v6' = (r(mean))^2
summarize PvdA if treatment=="PI" & completed==1
scalar `v7' = (r(mean))^2
summarize CU if treatment=="PI" & completed==1
scalar `v8' = (r(mean))^2
summarize Dieren if treatment=="PI" & completed==1
scalar `v9' = (r(mean))^2
summarize PLUS if treatment=="PI" & completed==1
scalar `v10' = (r(mean))^2
summarize SGP if treatment=="PI" & completed==1
scalar `v11' = (r(mean))^2
summarize DENK if treatment=="PI" & completed==1
scalar `v12' = (r(mean))^2
summarize Forum if treatment=="PI" & completed==1
scalar `v13' = (r(mean))^2
summarize Piraten if treatment=="PI" & completed==1
scalar `v14' = (r(mean))^2
summarize BIJ1 if treatment=="PI" & completed==1
scalar `v15' = (r(mean))^2
summarize LP if treatment=="PI" & completed==1
scalar `v16' = (r(mean))^2
summarize BBB if treatment=="PI" & completed==1
scalar `v17' = (r(mean))^2
summarize Oranje if treatment=="PI" & completed==1
scalar `v18' = (r(mean))^2
summarize JONG if treatment=="PI" & completed==1
scalar `v19' = (r(mean))^2
summarize NIDA if treatment=="PI" & completed==1
scalar `v20' = (r(mean))^2
summarize NLBeter if treatment=="PI" & completed==1
scalar `v21' = (r(mean))^2
summarize Toekomst if treatment=="PI" & completed==1
scalar `v22' = (r(mean))^2
summarize Platform if treatment=="PI" & completed==1
scalar `v23' = (r(mean))^2
summarize Volt if treatment=="PI" & completed==1
scalar `v24' = (r(mean))^2
return scalar effective_n = 1/(`v1'+ `v2'+`v3'+`v4'+`v5'+`v6'+`v7'+`v8'+`v9'+`v10'+`v11'+`v12'+`v13'+`v14'+`v15'+`v16'+`v17'+`v18'+`v19'+`v20'+`v21'+`v22'+`v23'+`v24')
end

bootstrap effective_n=r(effective_n) if treatment=="PI" & completed==1, reps(1000) nowarn nodots: effective_numberPI

set seed 5102020

capture program drop effective_numberA
program define effective_numberA, rclass
tempname v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 all
summarize VVD if treatment=="A" & completed==1
scalar `v1' = r(sum)
summarize PVV if treatment=="A" & completed==1
scalar `v2' = r(sum)
summarize CDA if treatment=="A" & completed==1
scalar `v3' = r(sum)
summarize D66 if treatment=="A" & completed==1
scalar `v4' = r(sum)
summarize GROEN if treatment=="A" & completed==1
scalar `v5' = r(sum)
summarize SP if treatment=="A" & completed==1
scalar `v6' = r(sum)
summarize PvdA if treatment=="A" & completed==1
scalar `v7' = r(sum)
summarize CU if treatment=="A" & completed==1
scalar `v8' = r(sum)
summarize Dieren if treatment=="A" & completed==1
scalar `v9' =r(sum)
summarize PLUS if treatment=="A" & completed==1
scalar `v10' = r(sum)
summarize SGP if treatment=="A" & completed==1
scalar `v11' = r(sum)
summarize DENK if treatment=="A" & completed==1
scalar `v12' = r(sum)
summarize Forum if treatment=="A" & completed==1
scalar `v13' = r(sum)
summarize Piraten if treatment=="A" & completed==1
scalar `v14' = r(sum)
summarize BIJ1 if treatment=="A" & completed==1
scalar `v15' = r(sum)
summarize LP if treatment=="A" & completed==1
scalar `v16' = r(sum)
summarize BBB if treatment=="A" & completed==1
scalar `v17' = r(sum)
summarize Oranje if treatment=="A" & completed==1
scalar `v18' = r(sum)
summarize JONG if treatment=="A" & completed==1
scalar `v19' = r(sum)
summarize NIDA if treatment=="A" & completed==1
scalar `v20' = r(sum)
summarize NLBeter if treatment=="A" & completed==1
scalar `v21' = r(sum)
summarize Toekomst if treatment=="A" & completed==1
scalar `v22' = r(sum)
summarize Platform if treatment=="A" & completed==1
scalar `v23' = r(sum)
summarize Volt if treatment=="A" & completed==1
scalar `v24' = r(sum)
scalar `all' = `v1'+ `v2'+`v3'+`v4'+`v5'+`v6'+`v7'+`v8'+`v9'+`v10'+`v11'+`v12'+`v13'+`v14'+`v15'+`v16'+`v17'+`v18'+`v19'+`v20'+`v21'+`v22'+`v23'+`v24'
return scalar effective_n = 1/((`v1'/`all')^2+ (`v2'/`all')^2+(`v3'/`all')^2+(`v4'/`all')^2+(`v5'/`all')^2+(`v6'/`all')^2+(`v7'/`all')^2+(`v8'/`all')^2+(`v9'/`all')^2+(`v10'/`all')^2+(`v11'/`all')^2+(`v12'/`all')^2+(`v13'/`all')^2+(`v14'/`all')^2+(`v15'/`all')^2+(`v16'/`all')^2+(`v17'/`all')^2+(`v18'/`all')^2+(`v19'/`all')^2+(`v20'/`all')^2+(`v21'/`all')^2+(`v22'/`all')^2+(`v23'/`all')^2+(`v24'/`all')^2)
end

bootstrap effective_n=r(effective_n) if treatment=="A" & completed==1, reps(1000) nowarn nodots: effective_numberA

set seed 5102020

capture program drop effective_numberAI
program define effective_numberAI, rclass
tempname v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 all
summarize VVD if treatment=="AI" & completed==1
scalar `v1' = r(sum)
summarize PVV if treatment=="AI" & completed==1
scalar `v2' = r(sum)
summarize CDA if treatment=="AI" & completed==1
scalar `v3' = r(sum)
summarize D66 if treatment=="AI" & completed==1
scalar `v4' = r(sum)
summarize GROEN if treatment=="AI" & completed==1
scalar `v5' = r(sum)
summarize SP if treatment=="AI" & completed==1
scalar `v6' = r(sum)
summarize PvdA if treatment=="AI" & completed==1
scalar `v7' = r(sum)
summarize CU if treatment=="AI" & completed==1
scalar `v8' = r(sum)
summarize Dieren if treatment=="AI" & completed==1
scalar `v9' =r(sum)
summarize PLUS if treatment=="AI" & completed==1
scalar `v10' = r(sum)
summarize SGP if treatment=="AI" & completed==1
scalar `v11' = r(sum)
summarize DENK if treatment=="AI" & completed==1
scalar `v12' = r(sum)
summarize Forum if treatment=="AI" & completed==1
scalar `v13' = r(sum)
summarize Piraten if treatment=="AI" & completed==1
scalar `v14' = r(sum)
summarize BIJ1 if treatment=="AI" & completed==1
scalar `v15' = r(sum)
summarize LP if treatment=="AI" & completed==1
scalar `v16' = r(sum)
summarize BBB if treatment=="AI" & completed==1
scalar `v17' = r(sum)
summarize Oranje if treatment=="AI" & completed==1
scalar `v18' = r(sum)
summarize JONG if treatment=="AI" & completed==1
scalar `v19' = r(sum)
summarize NIDA if treatment=="AI" & completed==1
scalar `v20' = r(sum)
summarize NLBeter if treatment=="AI" & completed==1
scalar `v21' = r(sum)
summarize Toekomst if treatment=="AI" & completed==1
scalar `v22' = r(sum)
summarize Platform if treatment=="AI" & completed==1
scalar `v23' = r(sum)
summarize Volt if treatment=="AI" & completed==1
scalar `v24' = r(sum)
scalar `all' = `v1'+ `v2'+`v3'+`v4'+`v5'+`v6'+`v7'+`v8'+`v9'+`v10'+`v11'+`v12'+`v13'+`v14'+`v15'+`v16'+`v17'+`v18'+`v19'+`v20'+`v21'+`v22'+`v23'+`v24'
return scalar effective_n = 1/((`v1'/`all')^2+ (`v2'/`all')^2+(`v3'/`all')^2+(`v4'/`all')^2+(`v5'/`all')^2+(`v6'/`all')^2+(`v7'/`all')^2+(`v8'/`all')^2+(`v9'/`all')^2+(`v10'/`all')^2+(`v11'/`all')^2+(`v12'/`all')^2+(`v13'/`all')^2+(`v14'/`all')^2+(`v15'/`all')^2+(`v16'/`all')^2+(`v17'/`all')^2+(`v18'/`all')^2+(`v19'/`all')^2+(`v20'/`all')^2+(`v21'/`all')^2+(`v22'/`all')^2+(`v23'/`all')^2+(`v24'/`all')^2)
end

bootstrap effective_n=r(effective_n) if treatment=="AI" & completed==1, reps(1000) nowarn nodots: effective_numberAI

set seed 5102020

capture program drop differencePPI
program define differencePPI, rclass
tempname v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 vi1 vi2 vi3 vi4 vi5 vi6 vi7 vi8 vi9 vi10 vi11 vi12 vi13 vi14 vi15 vi16 vi17 vi18 vi19 vi20 vi21 vi22 vi23 vi24 en eni
summarize VVD if treatment=="P" & completed==1
scalar `v1' = (r(mean))^2
summarize PVV if treatment=="P" & completed==1
scalar `v2' = (r(mean))^2
summarize CDA if treatment=="P" & completed==1
scalar `v3' = (r(mean))^2
summarize D66 if treatment=="P" & completed==1
scalar `v4' = (r(mean))^2
summarize GROEN if treatment=="P" & completed==1
scalar `v5' = (r(mean))^2
summarize SP if treatment=="P" & completed==1
scalar `v6' = (r(mean))^2
summarize PvdA if treatment=="P" & completed==1
scalar `v7' = (r(mean))^2
summarize CU if treatment=="P" & completed==1
scalar `v8' = (r(mean))^2
summarize Dieren if treatment=="P" & completed==1
scalar `v9' = (r(mean))^2
summarize PLUS if treatment=="P" & completed==1
scalar `v10' = (r(mean))^2
summarize SGP if treatment=="P" & completed==1
scalar `v11' = (r(mean))^2
summarize DENK if treatment=="P" & completed==1
scalar `v12' = (r(mean))^2
summarize Forum if treatment=="P" & completed==1
scalar `v13' = (r(mean))^2
summarize Piraten if treatment=="P" & completed==1
scalar `v14' = (r(mean))^2
summarize BIJ1 if treatment=="P" & completed==1
scalar `v15' = (r(mean))^2
summarize LP if treatment=="P" & completed==1
scalar `v16' = (r(mean))^2
summarize BBB if treatment=="P" & completed==1
scalar `v17' = (r(mean))^2
summarize Oranje if treatment=="P" & completed==1
scalar `v18' = (r(mean))^2
summarize JONG if treatment=="P" & completed==1
scalar `v19' = (r(mean))^2
summarize NIDA if treatment=="P" & completed==1
scalar `v20' = (r(mean))^2
summarize NLBeter if treatment=="P" & completed==1
scalar `v21' = (r(mean))^2
summarize Toekomst if treatment=="P" & completed==1
scalar `v22' = (r(mean))^2
summarize Platform if treatment=="P" & completed==1
scalar `v23' = (r(mean))^2
summarize Volt if treatment=="P" & completed==1
scalar `v24' = (r(mean))^2
scalar `en' = 1/(`v1'+ `v2'+`v3'+`v4'+`v5'+`v6'+`v7'+`v8'+`v9'+`v10'+`v11'+`v12'+`v13'+`v14'+`v15'+`v16'+`v17'+`v18'+`v19'+`v20'+`v21'+`v22'+`v23'+`v24')
summarize VVD if treatment=="PI" & completed==1
scalar `vi1' = (r(mean))^2
summarize PVV if treatment=="PI" & completed==1
scalar `vi2' = (r(mean))^2
summarize CDA if treatment=="PI" & completed==1
scalar `vi3' = (r(mean))^2
summarize D66 if treatment=="PI" & completed==1
scalar `vi4' = (r(mean))^2
summarize GROEN if treatment=="PI" & completed==1
scalar `vi5' = (r(mean))^2
summarize SP if treatment=="PI" & completed==1
scalar `vi6' = (r(mean))^2
summarize PvdA if treatment=="PI" & completed==1
scalar `vi7' = (r(mean))^2
summarize CU if treatment=="PI" & completed==1
scalar `vi8' = (r(mean))^2
summarize Dieren if treatment=="PI" & completed==1
scalar `vi9' = (r(mean))^2
summarize PLUS if treatment=="PI" & completed==1
scalar `vi10' = (r(mean))^2
summarize SGP if treatment=="PI" & completed==1
scalar `vi11' = (r(mean))^2
summarize DENK if treatment=="PI" & completed==1
scalar `vi12' = (r(mean))^2
summarize Forum if treatment=="PI" & completed==1
scalar `vi13' = (r(mean))^2
summarize Piraten if treatment=="PI" & completed==1
scalar `vi14' = (r(mean))^2
summarize BIJ1 if treatment=="PI" & completed==1
scalar `vi15' = (r(mean))^2
summarize LP if treatment=="PI" & completed==1
scalar `vi16' = (r(mean))^2
summarize BBB if treatment=="PI" & completed==1
scalar `vi17' = (r(mean))^2
summarize Oranje if treatment=="PI" & completed==1
scalar `vi18' = (r(mean))^2
summarize JONG if treatment=="PI" & completed==1
scalar `vi19' = (r(mean))^2
summarize NIDA if treatment=="PI" & completed==1
scalar `vi20' = (r(mean))^2
summarize NLBeter if treatment=="PI" & completed==1
scalar `vi21' = (r(mean))^2
summarize Toekomst if treatment=="PI" & completed==1
scalar `vi22' = (r(mean))^2
summarize Platform if treatment=="PI" & completed==1
scalar `vi23' = (r(mean))^2
summarize Volt if treatment=="PI" & completed==1
scalar `vi24' = (r(mean))^2
scalar `eni' = 1/(`vi1'+ `vi2'+`vi3'+`vi4'+`vi5'+`vi6'+`vi7'+`vi8'+`vi9'+`vi10'+`vi11'+`vi12'+`vi13'+`vi14'+`vi15'+`vi16'+`vi17'+`vi18'+`vi19'+`vi20'+`vi21'+`vi22'+`vi23'+`vi24')
return scalar difference= `en' - `eni'
end

bootstrap difference=r(difference) if treatment=="P" | treatment=="PI", reps(1000) nowarn nodots: differencePPI

set seed 5102020

capture program drop differenceAAI
program define differenceAAI, rclass
tempname v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 vi1 vi2 vi3 vi4 vi5 vi6 vi7 vi8 vi9 vi10 vi11 vi12 vi13 vi14 vi15 vi16 vi17 vi18 vi19 vi20 vi21 vi22 vi23 vi24 all en alli eni
summarize VVD if treatment=="A" & completed==1
scalar `v1' = r(sum)
summarize PVV if treatment=="A" & completed==1
scalar `v2' = r(sum)
summarize CDA if treatment=="A" & completed==1
scalar `v3' = r(sum)
summarize D66 if treatment=="A" & completed==1
scalar `v4' = r(sum)
summarize GROEN if treatment=="A" & completed==1
scalar `v5' = r(sum)
summarize SP if treatment=="A" & completed==1
scalar `v6' = r(sum)
summarize PvdA if treatment=="A" & completed==1
scalar `v7' = r(sum)
summarize CU if treatment=="A" & completed==1
scalar `v8' = r(sum)
summarize Dieren if treatment=="A" & completed==1
scalar `v9' =r(sum)
summarize PLUS if treatment=="A" & completed==1
scalar `v10' = r(sum)
summarize SGP if treatment=="A" & completed==1
scalar `v11' = r(sum)
summarize DENK if treatment=="A" & completed==1
scalar `v12' = r(sum)
summarize Forum if treatment=="A" & completed==1
scalar `v13' = r(sum)
summarize Piraten if treatment=="A" & completed==1
scalar `v14' = r(sum)
summarize BIJ1 if treatment=="A" & completed==1
scalar `v15' = r(sum)
summarize LP if treatment=="A" & completed==1
scalar `v16' = r(sum)
summarize BBB if treatment=="A" & completed==1
scalar `v17' = r(sum)
summarize Oranje if treatment=="A" & completed==1
scalar `v18' = r(sum)
summarize JONG if treatment=="A" & completed==1
scalar `v19' = r(sum)
summarize NIDA if treatment=="A" & completed==1
scalar `v20' = r(sum)
summarize NLBeter if treatment=="A" & completed==1
scalar `v21' = r(sum)
summarize Toekomst if treatment=="A" & completed==1
scalar `v22' = r(sum)
summarize Platform if treatment=="A" & completed==1
scalar `v23' = r(sum)
summarize Volt if treatment=="A" & completed==1
scalar `v24' = r(sum)
scalar `all' = `v1'+ `v2'+`v3'+`v4'+`v5'+`v6'+`v7'+`v8'+`v9'+`v10'+`v11'+`v12'+`v13'+`v14'+`v15'+`v16'+`v17'+`v18'+`v19'+`v20'+`v21'+`v22'+`v23'+`v24'
scalar `en' = 1/((`v1'/`all')^2+ (`v2'/`all')^2+(`v3'/`all')^2+(`v4'/`all')^2+(`v5'/`all')^2+(`v6'/`all')^2+(`v7'/`all')^2+(`v8'/`all')^2+(`v9'/`all')^2+(`v10'/`all')^2+(`v11'/`all')^2+(`v12'/`all')^2+(`v13'/`all')^2+(`v14'/`all')^2+(`v15'/`all')^2+(`v16'/`all')^2+(`v17'/`all')^2+(`v18'/`all')^2+(`v19'/`all')^2+(`v20'/`all')^2+(`v21'/`all')^2+(`v22'/`all')^2+(`v23'/`all')^2+(`v24'/`all')^2)
summarize VVD if treatment=="AI" & completed==1
scalar `vi1' = r(sum)
summarize PVV if treatment=="AI" & completed==1
scalar `vi2' = r(sum)
summarize CDA if treatment=="AI" & completed==1
scalar `vi3' = r(sum)
summarize D66 if treatment=="AI" & completed==1
scalar `vi4' = r(sum)
summarize GROEN if treatment=="AI" & completed==1
scalar `vi5' = r(sum)
summarize SP if treatment=="AI" & completed==1
scalar `vi6' = r(sum)
summarize PvdA if treatment=="AI" & completed==1
scalar `vi7' = r(sum)
summarize CU if treatment=="AI" & completed==1
scalar `vi8' = r(sum)
summarize Dieren if treatment=="AI" & completed==1
scalar `vi9' =r(sum)
summarize PLUS if treatment=="AI" & completed==1
scalar `vi10' = r(sum)
summarize SGP if treatment=="AI" & completed==1
scalar `vi11' = r(sum)
summarize DENK if treatment=="AI" & completed==1
scalar `vi12' = r(sum)
summarize Forum if treatment=="AI" & completed==1
scalar `vi13' = r(sum)
summarize Piraten if treatment=="AI" & completed==1
scalar `vi14' = r(sum)
summarize BIJ1 if treatment=="AI" & completed==1
scalar `vi15' = r(sum)
summarize LP if treatment=="AI" & completed==1
scalar `vi16' = r(sum)
summarize BBB if treatment=="AI" & completed==1
scalar `vi17' = r(sum)
summarize Oranje if treatment=="AI" & completed==1
scalar `vi18' = r(sum)
summarize JONG if treatment=="AI" & completed==1
scalar `vi19' = r(sum)
summarize NIDA if treatment=="AI" & completed==1
scalar `vi20' = r(sum)
summarize NLBeter if treatment=="AI" & completed==1
scalar `vi21' = r(sum)
summarize Toekomst if treatment=="AI" & completed==1
scalar `vi22' = r(sum)
summarize Platform if treatment=="AI" & completed==1
scalar `vi23' = r(sum)
summarize Volt if treatment=="AI" & completed==1
scalar `vi24' = r(sum)
scalar `alli' = `vi1'+ `vi2'+`vi3'+`vi4'+`vi5'+`vi6'+`vi7'+`vi8'+`vi9'+`vi10'+`vi11'+`vi12'+`vi13'+`vi14'+`vi15'+`vi16'+`vi17'+`vi18'+`vi19'+`vi20'+`vi21'+`vi22'+`vi23'+`vi24'
scalar `eni' = 1/((`vi1'/`alli')^2+ (`vi2'/`alli')^2+(`vi3'/`alli')^2+(`vi4'/`alli')^2+(`vi5'/`alli')^2+(`vi6'/`alli')^2+(`vi7'/`alli')^2+(`vi8'/`alli')^2+(`vi9'/`alli')^2+(`vi10'/`alli')^2+(`vi11'/`alli')^2+(`vi12'/`alli')^2+(`vi13'/`alli')^2+(`vi14'/`alli')^2+(`vi15'/`alli')^2+(`vi16'/`alli')^2+(`vi17'/`alli')^2+(`vi18'/`alli')^2+(`vi19'/`alli')^2+(`vi20'/`alli')^2+(`vi21'/`alli')^2+(`vi22'/`alli')^2+(`vi23'/`alli')^2+(`vi24'/`alli')^2)
return scalar difference = `en'-`eni'
end

bootstrap difference=r(difference) if treatment=="A" | treatment=="AI", reps(1000) nowarn nodots: differenceAAI

set seed 5102020

capture program drop differencePA
program define differencePA, rclass
tempname v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 vi1 vi2 vi3 vi4 vi5 vi6 vi7 vi8 vi9 vi10 vi11 vi12 vi13 vi14 vi15 vi16 vi17 vi18 vi19 vi20 vi21 vi22 vi23 vi24 en eni alli
summarize VVD if treatment_num==1 & completed==1
scalar `v1' = (r(mean))^2
summarize PVV if treatment_num==1 & completed==1
scalar `v2' = (r(mean))^2
summarize CDA if treatment_num==1 & completed==1
scalar `v3' = (r(mean))^2
summarize D66 if treatment_num==1 & completed==1
scalar `v4' = (r(mean))^2
summarize GROEN if treatment_num==1 & completed==1
scalar `v5' = (r(mean))^2
summarize SP if treatment_num==1 & completed==1
scalar `v6' = (r(mean))^2
summarize PvdA if treatment_num==1 & completed==1
scalar `v7' = (r(mean))^2
summarize CU if treatment_num==1 & completed==1
scalar `v8' = (r(mean))^2
summarize Dieren if treatment_num==1 & completed==1
scalar `v9' = (r(mean))^2
summarize PLUS if treatment_num==1 & completed==1
scalar `v10' = (r(mean))^2
summarize SGP if treatment_num==1 & completed==1
scalar `v11' = (r(mean))^2
summarize DENK if treatment_num==1 & completed==1
scalar `v12' = (r(mean))^2
summarize Forum if treatment_num==1 & completed==1
scalar `v13' = (r(mean))^2
summarize Piraten if treatment_num==1 & completed==1
scalar `v14' = (r(mean))^2
summarize BIJ1 if treatment_num==1 & completed==1
scalar `v15' = (r(mean))^2
summarize LP if treatment_num==1 & completed==1
scalar `v16' = (r(mean))^2
summarize BBB if treatment_num==1 & completed==1
scalar `v17' = (r(mean))^2
summarize Oranje if treatment_num==1 & completed==1
scalar `v18' = (r(mean))^2
summarize JONG if treatment_num==1 & completed==1
scalar `v19' = (r(mean))^2
summarize NIDA if treatment_num==1 & completed==1
scalar `v20' = (r(mean))^2
summarize NLBeter if treatment_num==1 & completed==1
scalar `v21' = (r(mean))^2
summarize Toekomst if treatment_num==1 & completed==1
scalar `v22' = (r(mean))^2
summarize Platform if treatment_num==1 & completed==1
scalar `v23' = (r(mean))^2
summarize Volt if treatment_num==1 & completed==1
scalar `v24' = (r(mean))^2
scalar `en' = 1/(`v1'+ `v2'+`v3'+`v4'+`v5'+`v6'+`v7'+`v8'+`v9'+`v10'+`v11'+`v12'+`v13'+`v14'+`v15'+`v16'+`v17'+`v18'+`v19'+`v20'+`v21'+`v22'+`v23'+`v24')
summarize VVD if treatment_num==3 & completed==1
scalar `vi1' = r(sum)
summarize PVV if treatment_num==3 & completed==1
scalar `vi2' = r(sum)
summarize CDA if treatment_num==3 & completed==1
scalar `vi3' = r(sum)
summarize D66 if treatment_num==3 & completed==1
scalar `vi4' = r(sum)
summarize GROEN if treatment_num==3 & completed==1
scalar `vi5' = r(sum)
summarize SP if treatment_num==3 & completed==1
scalar `vi6' = r(sum)
summarize PvdA if treatment_num==3 & completed==1
scalar `vi7' = r(sum)
summarize CU if treatment_num==3 & completed==1
scalar `vi8' = r(sum)
summarize Dieren if treatment_num==3 & completed==1
scalar `vi9' =r(sum)
summarize PLUS if treatment_num==3 & completed==1
scalar `vi10' = r(sum)
summarize SGP if treatment_num==3 & completed==1
scalar `vi11' = r(sum)
summarize DENK if treatment_num==3 & completed==1
scalar `vi12' = r(sum)
summarize Forum if treatment_num==3 & completed==1
scalar `vi13' = r(sum)
summarize Piraten if treatment_num==3 & completed==1
scalar `vi14' = r(sum)
summarize BIJ1 if treatment_num==3 & completed==1
scalar `vi15' = r(sum)
summarize LP if treatment_num==3 & completed==1
scalar `vi16' = r(sum)
summarize BBB if treatment_num==3 & completed==1
scalar `vi17' = r(sum)
summarize Oranje if treatment_num==3 & completed==1
scalar `vi18' = r(sum)
summarize JONG if treatment_num==3 & completed==1
scalar `vi19' = r(sum)
summarize NIDA if treatment_num==3 & completed==1
scalar `vi20' = r(sum)
summarize NLBeter if treatment_num==3 & completed==1
scalar `vi21' = r(sum)
summarize Toekomst if treatment_num==3 & completed==1
scalar `vi22' = r(sum)
summarize Platform if treatment_num==3 & completed==1
scalar `vi23' = r(sum)
summarize Volt if treatment_num==3 & completed==1
scalar `vi24' = r(sum)
scalar `alli' = `vi1'+ `vi2'+`vi3'+`vi4'+`vi5'+`vi6'+`vi7'+`vi8'+`vi9'+`vi10'+`vi11'+`vi12'+`vi13'+`vi14'+`vi15'+`vi16'+`vi17'+`vi18'+`vi19'+`vi20'+`vi21'+`vi22'+`vi23'+`vi24'
scalar `eni' = 1/((`vi1'/`alli')^2+ (`vi2'/`alli')^2+(`vi3'/`alli')^2+(`vi4'/`alli')^2+(`vi5'/`alli')^2+(`vi6'/`alli')^2+(`vi7'/`alli')^2+(`vi8'/`alli')^2+(`vi9'/`alli')^2+(`vi10'/`alli')^2+(`vi11'/`alli')^2+(`vi12'/`alli')^2+(`vi13'/`alli')^2+(`vi14'/`alli')^2+(`vi15'/`alli')^2+(`vi16'/`alli')^2+(`vi17'/`alli')^2+(`vi18'/`alli')^2+(`vi19'/`alli')^2+(`vi20'/`alli')^2+(`vi21'/`alli')^2+(`vi22'/`alli')^2+(`vi23'/`alli')^2+(`vi24'/`alli')^2)
return scalar difference= `en' - `eni'
end

**permute treatment_num r(difference) , reps(1000) dots(100): differencePA if treatment_num==1 | treatment_num==3

bootstrap difference=r(difference) if treatment=="P" | treatment=="A", reps(1000) nowarn nodots: differencePA

set seed 5102020

capture program drop differencePIAI
program define differencePIAI, rclass
tempname v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 vi1 vi2 vi3 vi4 vi5 vi6 vi7 vi8 vi9 vi10 vi11 vi12 vi13 vi14 vi15 vi16 vi17 vi18 vi19 vi20 vi21 vi22 vi23 vi24 en eni alli
summarize VVD if treatment=="PI" & completed==1
scalar `v1' = (r(mean))^2
summarize PVV if treatment=="PI" & completed==1
scalar `v2' = (r(mean))^2
summarize CDA if treatment=="PI" & completed==1
scalar `v3' = (r(mean))^2
summarize D66 if treatment=="PI" & completed==1
scalar `v4' = (r(mean))^2
summarize GROEN if treatment=="PI" & completed==1
scalar `v5' = (r(mean))^2
summarize SP if treatment=="PI" & completed==1
scalar `v6' = (r(mean))^2
summarize PvdA if treatment=="PI" & completed==1
scalar `v7' = (r(mean))^2
summarize CU if treatment=="PI" & completed==1
scalar `v8' = (r(mean))^2
summarize Dieren if treatment=="PI" & completed==1
scalar `v9' = (r(mean))^2
summarize PLUS if treatment=="PI" & completed==1
scalar `v10' = (r(mean))^2
summarize SGP if treatment=="PI" & completed==1
scalar `v11' = (r(mean))^2
summarize DENK if treatment=="PI" & completed==1
scalar `v12' = (r(mean))^2
summarize Forum if treatment=="PI" & completed==1
scalar `v13' = (r(mean))^2
summarize Piraten if treatment=="PI" & completed==1
scalar `v14' = (r(mean))^2
summarize BIJ1 if treatment=="PI" & completed==1
scalar `v15' = (r(mean))^2
summarize LP if treatment=="PI" & completed==1
scalar `v16' = (r(mean))^2
summarize BBB if treatment=="PI" & completed==1
scalar `v17' = (r(mean))^2
summarize Oranje if treatment=="PI" & completed==1
scalar `v18' = (r(mean))^2
summarize JONG if treatment=="PI" & completed==1
scalar `v19' = (r(mean))^2
summarize NIDA if treatment=="PI" & completed==1
scalar `v20' = (r(mean))^2
summarize NLBeter if treatment=="PI" & completed==1
scalar `v21' = (r(mean))^2
summarize Toekomst if treatment=="PI" & completed==1
scalar `v22' = (r(mean))^2
summarize Platform if treatment=="PI" & completed==1
scalar `v23' = (r(mean))^2
summarize Volt if treatment=="PI" & completed==1
scalar `v24' = (r(mean))^2
scalar `en' = 1/(`v1'+ `v2'+`v3'+`v4'+`v5'+`v6'+`v7'+`v8'+`v9'+`v10'+`v11'+`v12'+`v13'+`v14'+`v15'+`v16'+`v17'+`v18'+`v19'+`v20'+`v21'+`v22'+`v23'+`v24')
summarize VVD if treatment=="AI" & completed==1
scalar `vi1' = r(sum)
summarize PVV if treatment=="AI" & completed==1
scalar `vi2' = r(sum)
summarize CDA if treatment=="AI" & completed==1
scalar `vi3' = r(sum)
summarize D66 if treatment=="AI" & completed==1
scalar `vi4' = r(sum)
summarize GROEN if treatment=="AI" & completed==1
scalar `vi5' = r(sum)
summarize SP if treatment=="AI" & completed==1
scalar `vi6' = r(sum)
summarize PvdA if treatment=="AI" & completed==1
scalar `vi7' = r(sum)
summarize CU if treatment=="AI" & completed==1
scalar `vi8' = r(sum)
summarize Dieren if treatment=="AI" & completed==1
scalar `vi9' =r(sum)
summarize PLUS if treatment=="AI" & completed==1
scalar `vi10' = r(sum)
summarize SGP if treatment=="AI" & completed==1
scalar `vi11' = r(sum)
summarize DENK if treatment=="AI" & completed==1
scalar `vi12' = r(sum)
summarize Forum if treatment=="AI" & completed==1
scalar `vi13' = r(sum)
summarize Piraten if treatment=="AI" & completed==1
scalar `vi14' = r(sum)
summarize BIJ1 if treatment=="AI" & completed==1
scalar `vi15' = r(sum)
summarize LP if treatment=="AI" & completed==1
scalar `vi16' = r(sum)
summarize BBB if treatment=="AI" & completed==1
scalar `vi17' = r(sum)
summarize Oranje if treatment=="AI" & completed==1
scalar `vi18' = r(sum)
summarize JONG if treatment=="AI" & completed==1
scalar `vi19' = r(sum)
summarize NIDA if treatment=="AI" & completed==1
scalar `vi20' = r(sum)
summarize NLBeter if treatment=="AI" & completed==1
scalar `vi21' = r(sum)
summarize Toekomst if treatment=="AI" & completed==1
scalar `vi22' = r(sum)
summarize Platform if treatment=="AI" & completed==1
scalar `vi23' = r(sum)
summarize Volt if treatment=="AI" & completed==1
scalar `vi24' = r(sum)
scalar `alli' = `vi1'+ `vi2'+`vi3'+`vi4'+`vi5'+`vi6'+`vi7'+`vi8'+`vi9'+`vi10'+`vi11'+`vi12'+`vi13'+`vi14'+`vi15'+`vi16'+`vi17'+`vi18'+`vi19'+`vi20'+`vi21'+`vi22'+`vi23'+`vi24'
scalar `eni' = 1/((`vi1'/`alli')^2+ (`vi2'/`alli')^2+(`vi3'/`alli')^2+(`vi4'/`alli')^2+(`vi5'/`alli')^2+(`vi6'/`alli')^2+(`vi7'/`alli')^2+(`vi8'/`alli')^2+(`vi9'/`alli')^2+(`vi10'/`alli')^2+(`vi11'/`alli')^2+(`vi12'/`alli')^2+(`vi13'/`alli')^2+(`vi14'/`alli')^2+(`vi15'/`alli')^2+(`vi16'/`alli')^2+(`vi17'/`alli')^2+(`vi18'/`alli')^2+(`vi19'/`alli')^2+(`vi20'/`alli')^2+(`vi21'/`alli')^2+(`vi22'/`alli')^2+(`vi23'/`alli')^2+(`vi24'/`alli')^2)
return scalar difference= `en' - `eni'
end

bootstrap difference=r(difference), reps(1000) nowarn nodots: differencePIAI

tabi 60 53 20 20 26 34 33 8 24 9 5 0 19 0 0 0 1 0 0 0 0 6 0 2 \ 51 51 20 22 17 32 26 12 32 16 3 2 26 2 0 1 0 1 1 0 0 4 0 1
tabi 95 89 39 45 49 45 43 24 38 32 7 10 50 4 1 2 1 3 1 1 2 8 4 4 \ 73 83 42 40 42 49 45 27 29 29 2 4 34 5 1 2 1 2 2 1 3 10 4 2
ranksum total_votes if completed==1 & (treatment=="A" | treatment=="AI"), by(treatment)
ttest total_votes if completed==1 & (treatment=="A" | treatment=="AI"), by(treatment)

***Analyse centrality of votes
tabulate treatment if completed==1 & checked!=0 , sum( ed_center)
ci mean ed_center if completed==1 & votes_for_unlisted==0 & treatment=="P"
ci mean ed_center if completed==1 & votes_for_unlisted==0 & treatment=="PI"
ci mean ed_center if completed==1 & votes_for_unlisted==0 & treatment=="A"
ci mean ed_center if completed==1 & votes_for_unlisted==0 & treatment=="AI"
ttest ed_center if completed==1 & votes_for_unlisted==0 & (treatment=="P" | treatment=="PI"), by(treatment)
ttest ed_center if completed==1 & votes_for_unlisted==0 & (treatment=="A" | treatment=="AI"), by(treatment)
ttest ed_center if completed==1 & votes_for_unlisted==0 & (treatment=="P" | treatment=="A"), by(treatment)
ttest ed_center if completed==1 & votes_for_unlisted==0 & (treatment=="PI" | treatment=="AI"), by(treatment)

tabulate treatment if completed==1 & votes_for_unlisted==0 , sum( total_diff)
ci mean total_diff if completed==1 & votes_for_unlisted==0 & treatment=="P"
ci mean total_diff if completed==1 & votes_for_unlisted==0 & treatment=="PI"
ci mean total_diff if completed==1 & votes_for_unlisted==0 & treatment=="A"
ci mean total_diff if completed==1 & votes_for_unlisted==0 & treatment=="AI"
ttest total_diff if completed==1 & votes_for_unlisted==0 & (treatment=="P" | treatment=="PI"), by(treatment)
ttest total_diff if completed==1 & votes_for_unlisted==0 & (treatment=="A" | treatment=="AI"), by(treatment)
ttest total_diff if completed==1 & votes_for_unlisted==0 & (treatment=="P" | treatment=="A"), by(treatment)
ttest total_diff if completed==1 & votes_for_unlisted==0 & (treatment=="PI" | treatment=="AI"), by(treatment)
